package com.qf.thread;

public class DefendThreadTest {

	public static void main(String[] args) {
		//当前进程
		Thread tNow = Thread.currentThread();
		//创建新进程
		Thread t = new Thread();
		
		boolean isDefendNow = tNow.isDaemon();
		
		boolean isDefend = t.isDaemon();
		
		System.out.println(isDefendNow);
		
		System.out.println(isDefend);
		
		//如果改当前的线程，改为守护线程就直接非法语法异常
		//tNow.setDaemon(true);
		
		//修改的是创建新的线程，改为守护线程
		t.setDaemon(true);
		
		System.out.println(t.isDaemon());
		
		
		
	}
}
